#ifndef _DQUEUABLE_H
#define _DQUEUABLE_H

//==============================================================================
//
//       DQueuable - the protocol for a collection that acts as a queue
//
//               Copyright (C) 2004  Dick van Oudheusden
//  
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this library; if not, write to the Free
// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//==============================================================================
// 
//  $Date: 2004-06-24 12:32:19 $ $Revision: 1.2 $
//
//==============================================================================

// The DQueuable protocol specifies methods for classes that implements
// a queue.


@protocol DQueuable

//
// Return the number of stored objects
// 
// @return the length
// 
- (long) length;

//
// Check if the buffer is empty
// 
// @return is it ?
// 
- (BOOL) isEmpty;

//
// Put an object in the queue (FIFO)
//
// @param obj      the object 
//
// @return success (or buffer full)
//
- (BOOL) enqueue :(id) obj;

//
// Get an object from the queue (FIFO)
//
// @param obj      the object 
//
// @return the object (or nil for buffer empty)
//
- (id) dequeue ;

@end

#endif

